package net.zjitc.android2019.ch2activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import net.zjitc.android2019.R;

public class Ch2activitymain extends AppCompatActivity {
    private Button btn_1,btn_2,btn_3,btn_4;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_ch2activitymain);
        init();

        View.OnClickListener click = new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                switch (v.getId()){
                    case R.id.btn_rs:
                        rs();
                        break;
                    case R.id.btn_bmi:
                        bmi();
                        break;
                    case R.id.btn_beautya:
                        beautya();
                        break;
                    case R.id.btn_jsq:
                        jsq();
                        break;
                }
            }
        };
        btn_1.setOnClickListener(click);
        btn_2.setOnClickListener(click);
        btn_3.setOnClickListener(click);
        btn_4.setOnClickListener(click);
    }

    private void jsq() {

    }

    private void beautya() {
        Intent intent = new Intent(Ch2activitymain.this,BeautyActivity.class);
        startActivity(intent);
    }

    private void bmi() {
        Intent intent = new Intent(Ch2activitymain.this,BMIActivity.class);
        startActivity(intent);
    }

    private void rs() {
        Intent intent = new Intent(Ch2activitymain.this,RegisterActivity.class);
        startActivity(intent);
    }

    private void init() {
        btn_1=findViewById(R.id.btn_rs);
        btn_2=findViewById(R.id.btn_bmi);
        btn_3=findViewById(R.id.btn_beautya);
        btn_4=findViewById(R.id.btn_jsq);
    }
}
